import { request } from '@/libs/mqtt-request';
import config from '@/config';
import _ from 'lodash-es';
export const searchDevice = (params) => {
  return request(
    {
      url: '/clients',
      method: 'get',
      params,
      baseURL: (import.meta.env.MODE == 'development' ? config.mqttWebUrl.dev : config.mqttWebUrl.pro) + '/api/v4',
      headers: {
        Authorization: 'Basic ' + window.btoa('admin:public'),
      },
      timeout: 10000,
    },
    {
      isGetDataDirectly: false,
    },
  );
};
export const deviceQuery = (paging) => {
  let deviceData = _.pickBy({ ...paging });
  return request(
    {
      url: '/device/page',
      method: 'get',
      params: deviceData,
    },
    {
      isGetDataDirectly: false,
    },
  );
};
